/**
author: sailing
date: 2016/11/21
****/
<style lang='less'>
.el-select .el-input {
  width: 200px;
}
.search {
  position:absolute;
  right:5px;
  z-index:4000;
  
  margin-top:5px;
  margin-left:-150px;
}
</style>

<template>
  <div class='search' v-show='false'>
    <el-select :change='selectDrop()' v-model="value" placeholder="过滤槽位">
      <el-option
         v-for="item in cData"
        :label="item.serial"
        :value="item.name">
      </el-option>
    </el-select>
  </div>
</template>
<script>
import Vue from 'vue'
import eventBus from '../eventBus'
import searchNode from '../server/searchNode'
export default {
  data () {
    return {
      left: 180,
      input5: '',
      prepend: '设备',
      select: '1',
      value: '',
      flag: false,
      cData: []
    }
  },
  methods: {
    clickSearch () {
      searchNode.search(this.input5, this.select)
    },

    selectDrop () {
      if (this.value) {
        eventBus.bus.$emit('filterLine', this.value)
      }
    },

    hideAllBnt () {
      this.flag = false
    },

    caowei (data) {
      // data = data.sort()
      this.cData = data
    }
  },

  mounted: function () {
    eventBus.bus.$on('handlerCaowei', this.caowei.bind(this))
    eventBus.bus.$on('hideAllBnt', this.hideAllBnt.bind(this))
  }
}
</script>
